/// [Number spiral diagonals](https://projecteuler.net/problem=28)
fn main() {
    for n in &[5usize, 1001] {
        let len = (n + 1) / 2;
        let sum = (1..len).fold(1, |sum, x| sum + (x.pow(2) * 4 + x + 1) * 4);
        println!(
            "The sum of the numbers on the diagonals in a {0} by {0} spiral formed is {1}",
            n, sum
        );
    }
}
